<%-- 
    Document   : ManageHoliday
    Created on : Mar 30, 2011, 12:09:51 AM
    Author     : lycdragon
--%>
<%@page import="com.cardarus.operatingsystem.domain.ReminderType"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.cardarus.operatingsystem.domain.Reminder"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
        <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/css/template_css.css" media="screen"
              type="text/css" />
        <html:base/>

        <!-- calendar stylesheet -->
        <link rel="stylesheet" type="text/css" media="all" href="${pageContext.servletContext.contextPath}/js/calendar-win2k-cold-1.css" title="win2k-cold-1" />

        <!-- main calendar program -->
        <script type="text/javascript" src="${pageContext.servletContext.contextPath}/js/calendar.js"></script>

        <!-- language for the calendar -->
        <script type="text/javascript" src="${pageContext.servletContext.contextPath}/js/lang/calendar-en.js"></script>

        <!-- the following script defines the Calendar.setup helper function, which makes
             adding a calendar a matter of 1 or 2 lines of code. -->
        <script type="text/javascript" src="${pageContext.servletContext.contextPath}/js/calendar-setup.js"></script>



    </head>
    <body>
        <div class="container">
            <div class="header">
                <a href="#"><img src="${pageContext.servletContext.contextPath}/img/grlg.png" alt="Insert_logo" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #C6D580; display:block;"></a>
            </div><!-- end .header -->
            <div class="content">

                <table width="100%" border="0" cellspacing="0" cellpadding="0"
                       class="table-wrapper">
                    <tr>
                        <td>
                            <div align="right"> <html:link page="/views/menu.jsp">Home</html:link>&nbsp;&nbsp;<br/><br/></div>

                            <html:form action="/addHoliday" method="post">
                                <table width="60%" border="0">
                                    <tr>
                                        <td align="center"><font color="red"><html:errors property="holiday" /></font></td>
                                    </tr>
                                </table>
                                <table width="60%" border="0">
                                    <tr>
                                        <td width="26%">Start date:</td>
                                        <td width="74%"> <html:text styleId="startDateString" property="startDateString"   size="20"  />
                                            <img alt="cal"  src="${pageContext.servletContext.contextPath}/js/imgcal.gif" id="f_trigger_a" style="cursor: pointer; border: 1px solid red;" title="Date selector"
                                                 onmouseover="this.style.background='red';" onmouseout="this.style.background=''" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="26%">End date:</td>
                                        <td width="74%"> <html:text styleId="endDateString" property="endDateString"   size="20"  />
                                            <img alt="cal"  src="${pageContext.servletContext.contextPath}/js/imgcal.gif" id="f_trigger_b" style="cursor: pointer; border: 1px solid red;" title="Date selector"
                                                 onmouseover="this.style.background='red';" onmouseout="this.style.background=''" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="26%">Description:</td>
                                        <td width="74%"> <html:text property="description"  size="60" />
                                        </td>
                                    </tr>

                                    <tr>
                                        <td colspan="2"><p align="center">
                                                <html:submit value="Add This Holiday" />
                                                &nbsp;</p></td>
                                    </tr>
                                </table>
                            </html:form>
                            <div style="padding: 15px"> <html:errors />
                            </div>

                        </td>
                    </tr>
                </table>
                <h3> Holiday List</h3>

                <html:form action="/deleteHoliday" method="post">
                    <div style="width:100%;height:200px;overflow:auto;">
                        <table border="1">
                            <thead>
                                <tr>
                                    <th>Select</th>
                                    <th width="250">Description</th>
                                    <th width="120">Start Date</th>
                                    <th width="120">End Date</th>
                                </tr>
                            </thead>
                            <c:forEach var="r" items="${HolidayP}">
                                <tbody>
                                    <tr>
                                        <td><html:multibox  value="${r.id}" property="selectedRows" /></td>
                                        <td width="250">${r.description} </td>
                                        <td width="120"><fmt:formatDate value="${r.startDate}" pattern="MM/dd/yyyy"/></td>
                                        <td width="120"><fmt:formatDate value="${r.endDate}" pattern="MM/dd/yyyy" /></td>
                                    </tr>
                                </tbody>
                            </c:forEach>
                        </table>
                    </div>
                    <br/>
                    <input type="submit" value="Delete" name="delete" /> &nbsp;&nbsp;
                    <input type="reset" value="Clear Selection" />


                </html:form>



                <!-- YOUR CODE HERE -->



            </div><!-- end .content -->
        </div><!-- end .container -->
        <div class="footer">
            <p>Copyright 2011&nbsp;TigerSoft</p>
        </div><!-- end .footer -->
        <script type="text/javascript">
            Calendar.setup({
                inputField     :    "endDateString",      // id of the input field
                ifFormat       :    "%m/%d/%Y",       // format of the input field
                button         :    "f_trigger_b",   // trigger for the calendar (button ID)
                step           :    1                // show all years in drop-down boxes (instead of every other year as default)
            });
        </script>
        <script type="text/javascript">
            Calendar.setup({
                inputField     :    "startDateString",      // id of the input field
                ifFormat       :    "%m/%d/%Y",       // format of the input field
                button         :    "f_trigger_a",   // trigger for the calendar (button ID)
                step           :    1                // show all years in drop-down boxes (instead of every other year as default)
            });
        </script>

    </body>
</html>